/**
 * Copyright (c) 2012-2014 All Rights Reserved.
 */
package com.easy.framwork.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

/**
 * 关于jdbc的判断操作
 * 
 * @author wy
 * @version v 0.1 2014-1-2 下午8:28:53 wy Exp $
 */
public class JdbcAssertUtils {

    /**
     * 判断是否有效的链接
     * 
     * @param conn
     * @throws SQLException
     */
    public static void validConnection(Connection conn) throws SQLException {
        if (conn == null) {
            throw new SQLException("Null connection");
        } else if (conn.isClosed()) {
            throw new SQLException("connection is closed");
        }

    }

}
